package hzn.service.impl;

import bean.UserAddress;
import service.UserService;

import java.util.Arrays;
import java.util.List;

public class UserServiceImpl implements UserService {
    @Override
    public UserAddress getUserAddress(String userId) {
        try {
            Thread.sleep(200);
        } catch (InterruptedException e) {}
        System.out.println("this is xml provider");
        UserAddress a1=new UserAddress(1,"南京","1","孙武","138987","Y");
        UserAddress a2=new UserAddress(2,"北京","2","吴起","1309777","N");
        List<UserAddress>list= Arrays.asList(a1,a2);
        for(int i=0;i<list.size();i++){
            if(list.get(i).getUserId().equals(userId)){
                return list.get(i);
            }
        }
        return null;
    }
}
